﻿using HutongGames.PlayMaker;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CondFloat : BaseCond
{
    [UIHint(UIHint.FsmFloat)]
    public FsmFloat mVal1;
    public ECondition mCondition;
    [UIHint(UIHint.FsmFloat)]
    public FsmFloat mVal2;


    public override bool Condition()
    {
        if (mCondition == ECondition.Equal)
            return mVal1.Value == mVal2.Value;
        if (mCondition == ECondition.Less)
            return mVal1.Value < mVal2.Value;
        if (mCondition == ECondition.Greater)
            return mVal1.Value > mVal2.Value;

        return false;
    }
}

public class CondBool : BaseCond
{
    [UIHint(UIHint.FsmBool)]
    public FsmBool mVal1;
    public override bool Condition()
    {
        return mVal1.Value;
    }
}

public class CondString : BaseCond
{
    [UIHint(UIHint.FsmString)]
    public FsmString mVal1;
    [UIHint(UIHint.FsmString)]
    public FsmString mVal2;


    public override bool Condition()
    {
        return mVal1.Equals(mVal2);
    }
}

public class CondMethod : BaseCond
{
    [UIHint(UIHint.Method)]
    public FsmString mVal1;
    [UIHint(UIHint.Method)]
    public FsmString mVal2;
    
    public override bool Condition()
    {
        return mVal1.Equals(mVal2);
    }
}
[SerializeField]
public class BaseCond
{
    public string mEventName;

    public string GetEventName()
    {
        return mEventName;
    }

    public virtual bool Condition()
    {
        return false;
    }

}
public enum ECondition
{
    Less,
    Equal,
    Greater
}